//Send all players to their respective respawn point

private ["_unit","_markername"];



_code={hint "Teleporting you to your spawn... Done"; cutText ["","BLACK OUT",1];sleep 1;cutText ["","BLACK IN",1];};
[_code] execVM "scripts\VTS_Functions\runcodeonallclients.sqf";
sleep 1;

for [{_x=1},{_x<=nbre_joueursX},{_x=_x+1}] do
{
  call compile format["_unit=user%1",_x];
  
  if (!isnull _unit) then
  {
    _side=side _unit;
    call compile format["_markername=""Respawn_%1"";",_side];
    _pos=getmarkerpos _markername;
    _unit setpos [((_pos select 0)-5)+random 10,((_pos select 1)-5)+random 10];
  };
 
};


